<!DOCTYPE html>
<svg>
  <foreignObject id="target">
    <div style="position: sticky; top: 0;"></div>
  </foreignObject>
</svg>
<script>
document.body.offsetTop;
document.getElementById('target').style.overflow = 'visible';
</script>
